#ifdef MINIMUM_MEMORY
  #define UARTBUFFER_SIZE             5
#else
  #define UARTBUFFER_SIZE            20
#endif

#define UARTBUFFER_THROTTLE         3

typedef struct {
  uint8_t incoming;
  uint8_t data_len, *data;
} PACKING_MACRO UARTBUFFER_ENTRY;

UARTBUFFER_ENTRY *uart_buffer;
uint8_t uartbuffer_first, uartbuffer_last, uartbuffer_size;

void init_muart();
uint8_t update_uartbuffer(uint8_t *data, uint8_t *data_len);
void enqueue_uartmsg(uint8_t incoming, uint8_t data_len, uint8_t *data, ADDRESS source_node);
uint8_t uart_hassingletreemsgs();
